<?php
/**
 * Created by PhpStorm.
 * User: wangkxin@foxmail.com
 * Date: 2020/9/15
 * Time: 13:24
 */

namespace app\api\controller;
use think\Controller;
use app\bis\model\Category as CategoryModel;

class Category extends Controller
{
    private $obj;
    public function _initialize()
    {
        $this->obj =  new CategoryModel();
    }
    public function getCategoryByParentId()
    {
       $id = input('post.id');
       if(!$id){
           $this->error('参数不合法');
       }
       $categorys =  $this->obj->getNormalCategoryByParentId($id);
       if(!$categorys){
           return show(0,'error');
       }
       return show(1,'success',$categorys);
    }

}